Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support uses-permission merging in manifest merger #13445

Closed

Conversation

Bencodes
Copy link
Contributor

@Bencodes Bencodes commented May 7, 2021

Adding support for conditionally merging uses-permissions.

#10628
#5411

@google-cla google-cla bot added the cla: yes label May 7, 2021
@Bencodes Bencodes force-pushed the support-uses-permissions-merging branch 7 times, most recently from 345e7e6 to d0378fe Compare May 7, 2021 20:00
@lberki lberki removed their request for review May 10, 2021 06:01
@@ -176,8 +187,7 @@ private static Path removePermissions(Path manifest, Path outputDir)
}
}
// Write resulting manifest to the output directory, maintaining full path to prevent collisions
Path output = outputDir.resolve(manifest.toString().replaceFirst("^/", ""));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was failing on windows machines causing the original files to be modified in place.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be easier to import this PR if we can evaluate this change separately. Is it right that this was an existing problem and not needed for merging permissions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. I can pull this out into another PR that can be imported independently of this, but this PR will need to be rebased against that for the tests to pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulled this out into #13760

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Ben, if you've forked the Windows-related fixes into a separate PR, would you mind amending this PR to only include the changes for permission merging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ted-xie The tests for this wont pass on windows until the other PR lands. I'll rebase this once that lands.

@Bencodes
Copy link
Contributor Author

@ahumesky mind taking a look at this?

@Bencodes
Copy link
Contributor Author

@ahumesky can you help take a look?

@ahumesky ahumesky added the team-Android Issues for Android team label Jul 28, 2021
@Bencodes Bencodes force-pushed the support-uses-permissions-merging branch from 4024980 to 35bd48c Compare August 16, 2021 19:11
@Bencodes Bencodes force-pushed the support-uses-permissions-merging branch 2 times, most recently from dec1425 to 4191be0 Compare March 24, 2022 17:36
@Bencodes Bencodes force-pushed the support-uses-permissions-merging branch from 4191be0 to 7c584d1 Compare April 3, 2022 18:29
@bazel-io bazel-io closed this in 9119815 Apr 5, 2022
@nkoroste nkoroste mentioned this pull request May 4, 2022
6 tasks
@Bencodes Bencodes deleted the support-uses-permissions-merging branch June 2, 2022 22:09
ted-xie pushed a commit to ted-xie/bazel that referenced this pull request Jul 6, 2022
Adding support for conditionally merging `uses-permissions`.

bazelbuild#10628
bazelbuild#5411

Closes bazelbuild#13445.

RELNOTES: Enable merging permissions during Android manifest merging with the --merge_android_manifest_permissions flag.
PiperOrigin-RevId: 439613035
ted-xie pushed a commit to ted-xie/bazel that referenced this pull request Jul 6, 2022
Adding support for conditionally merging `uses-permissions`.

bazelbuild#10628
bazelbuild#5411

Closes bazelbuild#13445.

RELNOTES: Enable merging permissions during Android manifest merging with the --merge_android_manifest_permissions flag.
PiperOrigin-RevId: 439613035
ted-xie pushed a commit to ted-xie/bazel that referenced this pull request Jul 6, 2022
Adding support for conditionally merging `uses-permissions`.

bazelbuild#10628
bazelbuild#5411

Closes bazelbuild#13445.

RELNOTES: Enable merging permissions during Android manifest merging with the --merge_android_manifest_permissions flag.
PiperOrigin-RevId: 439613035
ckolli5 pushed a commit that referenced this pull request Jul 6, 2022
* Support uses-permission merging in manifest merger

Adding support for conditionally merging `uses-permissions`.

#10628
#5411

Closes #13445.

RELNOTES: Enable merging permissions during Android manifest merging with the --merge_android_manifest_permissions flag.
PiperOrigin-RevId: 439613035

* Make ManifestMergerAction worker compatible

Calling `System#exit` kills the worker during the build. Passing the exception up to the worker should be enough for it to end up in the worker or local execution output.

Closes #14427.

PiperOrigin-RevId: 447808701

* Fix ManifestMergerAction test case on windows

`manifest.toString().replaceFirst("^/", "")` silently fails on windows machines causing `removePermissions` to write to the original test file. This pull request creates a new temp file that `removePermissions` can write the modified manifest to.

Pulling this change out of another PR so that it's easier to merge. Original PR here https://github.com/bazelbuild/bazel/pull/13445/files#r631575251

Closes #13760.

PiperOrigin-RevId: 438643774

Co-authored-by: Ben Lee <ben@ben.cm>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes team-Android Issues for Android team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants